<?php $this->load->view('common/cms-head'); ?>
<article id="content">
    <div class="pgwrapper">
    <div class="w960 bg1 p15 bx_shw">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="20%" style="border-right: 2px solid #e5e5e5;" valign="top">
		<?php $this->load->view('enterprises/leftnavCMS'); ?>
		</td>
		<td width="80%" valign="top" style="padding:5px;"><form enctype="multipart/form-data"
				action="/updateBanner" method="POST">
				<table width="100%" border="0" cellpadding="5" cellspacing="0"
					style="padding: 0px 30px;">
					<input type="hidden" value="<?php echo $banner_id;?>" id="banner_id" name="banner_id">
					<tr>
						<td class="txt-blck">Select Store:</td>
						<td><select id="banner_store_id" name="banner_store_id" style="width: 200px;padding-top:5px;" onchange="" class="setBgInput">
							<?php foreach ($allStoresArray as $temp){ ?>
								<option <?php if ($temp['store_id']==$bannerDetailsArray[0]['banner_store_id']){ echo "selected"; }?> value="<?php echo $temp['store_id']; ?>">
								<?php echo $temp['store_name']; ?>
								</option>
								<?php } ?>
						</select></td>
					</tr></td>
					</tr>
					<tr>
						<td class="txt-blck">Select Category:</td>
						 <td><select id="banner_cat_id" name="banner_cat_id" style="width: 200px;padding-top:5px;" onchange="" class="setBgInput">
			                	<?php foreach ($allCategoriesArray as $temp){ ?>
								<option <?php if ($temp['category_id']==$bannerDetailsArray[0]['banner_category']){ echo "selected"; }?> 
								value="<?php echo $temp['category_id']; ?>">
								<?php echo $temp['category_name']; ?>
								</option>
								<?php } ?>		                	
			            	</select></td>
					</tr>
					<tr>
						<td class="txt-blck" width="30%">Banner Alt:</td>
						<td width="70%"><input type="text" onblur="makeURLName(this)"
							value="<?php echo $bannerDetailsArray[0]['banner_alt'];?>"
							name="banner_alt" id="banner_alt" style="width: 400px;" class="setBgInput"
							  />
						</td>
					</tr>
					<tr>
						<td></td>
						<td>
							<input type="radio" id="haveimg" name="haveimg" value="" onclick="showImage('1')" />Have Image
							<input type="radio" style="margin-left:20px" id="haveimgL" name="haveimgL" 
							onclick="showImage('2')" value="" checked="checked" />Have Image Link
						</td>
					</tr>
                    <tr>
						<td class="txt-blck" width="30%">Banner Image:</td>
						<td width="70%">
							<input type="text" value="<?php echo $bannerDetailsArray[0]['banner_image'];?>" name="banner_image"
							id="banner_image" style="width: 400px;" class="setBgInput" />
							
							<input type="file" style="display:none" id="banner_image_path" name="banner_image_path" class="setBgInput" />
							
						</td>
					</tr>
                    <tr>
						<td class="txt-blck" width="30%">Banner Link:</td>
						<td width="70%"><input type="text"
							value="<?php echo $bannerDetailsArray[0]['banner_link'];?>"
							name="banner_link" id="banner_link" style="width: 400px;" class="setBgInput"
							  />
						</td>
					</tr>
					<tr>
						<td class="txt-blck">Banner Status:</td>
						<td><select id="banner_status" name="banner_status" style="width:90px;padding-top:5px;" class="setBgInput">
								<option value="Yes"
								<?php if ($bannerDetailsArray[0]['banner_status']=="Yes"){echo "selected"; }?>>Yes</option>
								<option value="No"
								<?php if ($bannerDetailsArray[0]['banner_status']=="No"){echo "selected"; }?>>No</option>
						</select></td>
					</tr>
					<tr>
						<td></td>
						<td><input type="submit" name="banner_submit" value="Submit" class="btn_bg" /></td>
					</tr>
				</table>
			</form>
		</td>
	</tr>
</table>
</div>
</div>
</article>
<div class="clr-both spacer-10">&nbsp;</div>
<?php $this->load->view('common/cms-footer'); ?>
<script>
function showImage(a) {
	if (a == "1") {
		document.getElementById("haveimgL").checked = "";
		document.getElementById("banner_image_path").style.display = "block";
		document.getElementById("banner_image").style.display = "none"
	}
	if (a == "2") {
		document.getElementById("haveimg").checked = "";
		document.getElementById("banner_image").style.display = "block";
		document.getElementById("banner_image_path").style.display = "none"
	}
}
function validateForm(){
	var x = document.getElementById('banner_alt').value;
	if(x==""){
	alert("Banner Alt must be filled out.");
	return false;
	}
}
</script>